﻿namespace OasisCiq.Xprl
{
    using System.Collections.Specialized;
    using CommonTypes;
    using External;
    using XS;

    /// <summary>
    /// All relationship details between the two parties
    /// </summary>
    public class Relationship : IDataQualityGroup, ILanguageCodeGroup, IExtendedAttributes
    {
        /// <summary>
        /// The other party (could be individual (person or organisation) or a group) 
        /// in relationship with the party in context/discussion. This party in turn 
        /// can have relationship with another party and under this cicumstances, 
        /// this party is the party in context/discussion
        /// Note party required
        /// </summary>
        public virtual PartyType Party { get; set; }

        /// <summary>
        /// A unique identifier for the relationship
        /// </summary>
        public virtual CTString RelationshipId { get; set; }

        /// <summary>
        /// Type ofidentifier for relationship
        /// </summary>
        public virtual RelationshipIdTypeList RelationshipIdType { get; set; }

        /// <summary>
        /// Global unique identifier
        /// </summary>
        public virtual CTString Id { get; set; }

        /// <summary>
        /// Type of relationship between the two parties. e.g.Marriage (Husband-wife),
        /// IN TRUST FOR, DOING BUSINESS AS, Father-Son, Team Leader-Team Member, 
        /// Organisation-Employee, Parent-Subsidiary, Corporation, Supplier-Client, 
        /// Siblings, Employment, etc. Could be formal relationship titles.
        /// </summary>
        public virtual RelationshipTypeList RelationshipType { get; set; }

        /// <summary>
        /// Category of relationship between two parties. 
        /// e.g. Business, Personal, Formal, etc
        /// </summary>
        public virtual RelationshipCategoryList RelationshipCategory { get; set; }

        /// <summary>
        /// Status of relationship. e.g. current, history, potential, suspended
        /// </summary>
        public virtual RelationshipStatusList RelationshipStatus { get; set; }

        /// <summary>
        /// Date and Time when relationship was established
        /// </summary>
        public virtual XSDateTime RelationshipStartDateTime { get; set; }

        /// <summary>
        /// Date and Time when relationship ended (if it did). Ended could be suspended date also
        /// </summary>
        public virtual XSDateTime RelationshipEndDateTime { get; set; }

        /// <summary>
        /// Reason for start of a relationship. e.g. merger, fiancee, Friend, etc
        /// </summary>
        public virtual RelationshipStartReasonList RelationshipStartReason { get; set; }

        /// <summary>
        /// Reason why relationship ended (if it did). e.g. Lost contact, did not 
        /// renew maintenance contract, suspended account, renewal lapsed
        /// </summary>
        public virtual RelationshipEndReasonList RelationshipEndReason { get; set; }

        /// <summary>
        /// Whether Party 1 is higher or lower or equaly in relativity with Party 2. 
        /// For example, Party 1 manages Party2. Here relativity of Party 1 is "Higher" 
        /// than Party 2. If Party 1 and Party 2 are company directors, then Party 1 
        /// relativity is equalt to Party 2 relativity.
        /// </summary>
        public virtual RelationshipRelativityList RelationshipRelativityWithOtherParty { get; set; }

        /// <summary>
        /// Role of this party in its relationship with the other party. e.g. 
        /// Husband, Wife, Customer, Client, Supervisor, Parent, etc
        /// </summary>
        public virtual RelationshipRoleList RelationshipRole { get; set; }

        /// <summary>
        /// Role of the other party in its relationship with this party 
        /// (the party in context/discussion). e.g. Husband, Wife, 
        /// Customer, Client, Supervisor, Parent, etc
        /// </summary>
        public virtual OtherPartyRelationshipRoleList OtherPartyRelationshipRole { get; set; }

        /// <summary>
        /// Priority of the relationship between the two parties. e.g. 
        /// High, Medium, Low, insignificant, significant, etc
        /// </summary>
        public virtual RelationshipPriorityList RelationshipPriority { get; set; }

        /// <summary>
        /// This attribute indicates what level of trust can be given to the parent element.
        /// Omit this attribute if the data quality is unknown. If the data quality is known,
        /// the value is "Valid, else "InValid"
        /// </summary>
        public virtual DataQualityTypeList DataQualityType { get; set; }

        /// <summary>
        /// Date the data quality is valid from
        /// </summary>
        public virtual XSDateTime ValidFrom { get; set; }

        /// <summary>
        /// Date the data quality is valid to
        /// </summary>
        public virtual XSDateTime ValidTo { get; set; }

        /// <summary>
        /// Human Language used. e.g. "en", "en-US", "en-AUS", etc
        /// </summary>
        public virtual XSLanguage LanguageCode { get; set; }

        public virtual NameValueCollection ExtendedAttributes { get; set; }
    }
}
